package com.lonely.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lonely.common.core.domain.TimeLine;
import com.lonely.system.domain.dto.log.GetLogTimeLineDto;
import com.lonely.system.domain.entity.SysBusinessLog;
import com.lonely.system.engine.log.GetLogTimeLineFactory;
import com.lonely.system.engine.log.GetLogTimeModuleEnum;
import com.lonely.system.mapper.SysBusinessLogMapper;
import com.lonely.system.service.IBusinessLogService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : 黄志标
 * @date: 2025/9/19 16:57
 * @description: 业务日志服务实现类
 */
@Service
public class BusinessLogServiceImpl extends ServiceImpl<SysBusinessLogMapper, SysBusinessLog> implements IBusinessLogService {

    /**
     * 获取业务日志时间线
     *
     * @param queryDto
     * @return
     */
    @Override
    public List<TimeLine> getLogTimeLine(GetLogTimeLineDto queryDto) {
        GetLogTimeModuleEnum moduleEnum = GetLogTimeModuleEnum.getInstance(queryDto.getModuleName());
        return GetLogTimeLineFactory.getLogTimeLine(moduleEnum).getLogTimeLine(queryDto);
    }
}
